package Text12;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int res = n;
        while (n >= 3) {
            res += n / 3;
            n = n % 3 + n / 3;
        }
        System.out.println(res);
    }
}
